#include "processbar.h"

char lable[5] = "|/-\\";
void process()
{
	char buffer[NUM];
	memset(buffer, '\0', sizeof(buffer));
	int cnt = 0;
	int n = strlen(lable);
	buffer[0] = Head;
	while(cnt <= 100)
	{
		printf("[%-100s][%3d%%][%c]\r", buffer, cnt, lable[cnt % n]);
		fflush(stdout);
		buffer[cnt++] = Body;
		if(cnt < 100) 
			buffer[cnt] = Head;
		usleep(30000);
	}
	printf("\n");
}
